package com.jhworks.imageselect;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.squareup.picasso.Picasso;

import uk.co.senab.photoview.PhotoView;

/**
 * Created by Administrator on 2017/10/26.
 */

public class ImageBigActivity extends AppCompatActivity {

    private PhotoView img;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_big_img);
        img = (PhotoView) findViewById(R.id.img);
        String url = getIntent().getStringExtra("path");
//        Glide.with(this).load("http://static.daozijinfu.com/Uploads/Images/2016/11/01/58186a1d1da4c.jpg").into(img);

        Message message = new Message();
        message.what = 1 ;
        handler.sendMessage(message);

    }

    private Handler handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            switch (msg.what) {      //判断标志位
                case 1:
                    /**
                     获取数据，更新UI
                     */
                    Picasso.with(ImageBigActivity.this).load("http://static.daozijinfu.com/Uploads/Images/2016/11/01/58186a1d1da4c.jpg").placeholder(R.drawable.ic_photo_gray_63dp).into(img);
                    break;
            }
        }
    };
}
